﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using QLVMBAYDomain;

namespace QLVMBAY.UControl
{
    public partial class UcMenu : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                if (Session[ClientComm.KEY_DANG_NHAP] != null)
                {
                    var ngDung = (NguoiDung)Session[ClientComm.KEY_DANG_NHAP];
                    lnkQL.Visible = ngDung.LoaiND == LOAI_NGUOI_DUNG.ADMIN;
                    //    lblUser.Text = "Hi, " + ((NguoiDung)Session[ClientComm.KEY_DANG_NHAP]).MaNguoiDung;
                    //    lblUser.Visible = true;
                    //    lnkDangXuat.Visible = true;
                }
                else
                    lnkQL.Visible = false;
                //lblUser.Visible = Session[ClientComm.KEY_DANG_NHAP] != null;
                //lnkDangXuat.Visible = Session[ClientComm.KEY_DANG_NHAP] != null;
            }
        }      

        protected void lnkDangXuat_Click(object sender, EventArgs e)
        {
            //Session[ClientComm.KEY_DANG_NHAP] = null;
            //Response.Redirect("Default.aspx");
        }
    }
}